package com.zl.controller;

import com.zl.pojo.Order;
import com.zl.pojo.User;
import com.zl.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpRequest;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import java.util.List;
import java.util.Map;

@RequestMapping("/member")
@Controller
public class MemberController {
    @Autowired
    private OrderService os;
    @RequestMapping("/order")
    public String queryOrderByUserId(HttpSession session, Map<String,Object> args){


        User user= (User) session.getAttribute("user");
         int userId=user.getId();
        List<Order> order= os.queryOrderByUserId(userId);
      args.put("order",order);
      return "member/Member_Order";
    }
}
